import request from "@/utils/request.ts";
import type {SqlType} from "@/type/sql-type.ts";


export const getSqlApi = (data: any) => {
  return request({
    url: '/moyu/router/list',
    method: 'post',
    data
  })
}

export const getSqlById = (sqlId: string) => {
  return request({
    url: `/moyu/sql/${sqlId}`,
    method: 'GET'
  })
}

/**
 * 新增或更新SQL信息
 * @param data
 */
export const saveSql = (data:SqlType) => {
  return request({
    url: '/moyu/sql',
    method: 'POST',
    data
  })
}
